package cn.edu.tju.elm.model.entity;

import cn.edu.tju.core.model.BaseEntity;
import cn.edu.tju.core.model.User;
import jakarta.persistence.*;
import lombok.*;
import lombok.experimental.SuperBuilder;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.Where;

import java.math.BigDecimal;

@Entity
@Data
@SuperBuilder
@AllArgsConstructor
@NoArgsConstructor
@DynamicUpdate
@Where(clause = "is_deleted=false")
public class Business extends BaseEntity {
    @Column(nullable=false)
    private String businessName;
    @ManyToOne(fetch = FetchType.EAGER)
    @JoinColumn(name = "user_id", nullable = false)
    private User businessOwner;
    private String businessAddress;
    private String businessExplain;
    @Column(columnDefinition = "TEXT")
    private String businessImg;
    private Integer orderTypeId;
    @Column(precision = 10, scale = 2)
    private BigDecimal startPrice;
    @Column(precision = 10, scale = 2)
    private BigDecimal deliveryPrice;
    private String remarks;
}
